<script>
	import {update} from '@/common/update.js'
export default {
	onLaunch: function () {
		update() 
		uni.getNetworkType({
			success(res) {
				res.networkType === 'none'
					? uni.showToast({
							title: '当前无网络',
							icon: 'none'
					  })
					: '';
				if (res.networkType === '2g' || res.networkType === '3g') {
					uni.showToast({
						title: '当前网络不佳',
						icon: 'none'
					});
				}
			}
		});
		uni.onNetworkStatusChange((res) => {
			if (!res.isConnected) {
				uni.showToast({
					title: '当前无网络,请连接网络',
					icon: 'none'
				});
			}
		});
		// 初始化用户登录状态
		const userinfo = uni.getStorageSync('userInfo');
		if (userinfo) {
			this.$store.dispatch('initUser');
		}
	},
	onShow: function () {
		console.log('App Show');
	},
	onHide: function () {
		console.log('App Hide');
	}
};
</script>

<style>
@import url('static/font/iconfont.css');
/* 动态css样式 */
@import url('common/free.css');
@import url('common/animate.css');
@import url('common/uni.css');
@import url('common/common.css');

/* 隐藏滚动条 */
::-webkit-scrollbar {
	display: none;
}
</style>
